using PP.Basic;
using PP.PPPoker.Game.GJ25;
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace PP.PPPoker
{
    /// <summary>
    /// GJRuleLayer 对象
    /// </summary>
    public class GJRuleLayer : MonoBehaviour
    {
        private const string Tag = nameof(GJRuleLayer);
        
        // Private Variables Begin
        // Private Variables End
        
        // Static Methods Begin
        public static GJRuleLayer Create()
        {
            return UIManager.Instance.ShowView<GJRuleLayer>("Prefab/GJRuleLayer");
        }
        // Static Methods End
        
        // Public Methods Begin
        // Public Methods End
        
        // Lifecycle Methods Begin
        protected void Awake()
        {
            InitHier();
            InitPart();
        }

        private void InitPart()
        {
            // Do initialization here...
        }
        
        private void Start()
        {
            Debug.Log($"{Tag}.Start");
        }
        
        // Lifecycle Methods End

        // Hier Components Begin
        private Button _startButton;
        private void InitHier()
        {
            _startButton = transform.Find("ScrollView/Viewport/Content/Image2/_Button_Start").GetComponent<Button>();
            _startButton.onClick.AddListener(OnStartButtonClick);

        }

        private void OnStartButtonClick()
        {
            UIManager.Instance.CloseView<GJRuleLayer>();
        }
        // Hier Components End

        // Event Methods Begin
        // Event Methods End

        // Private Methods Begin
        // Private Methods End
    }
}
